<template>
  <div>
    {{newUser}}
    <button @click="user.username='zhangsan'">update</button>
  </div>
</template>

<script setup lang="ts">
import { reactive, computed } from 'vue'
const user = reactive({ username: 'jack' })
// const newUser = computed<string>(() => '你好' + user.username)
const newUser = computed({
  get: () => {
    return '你好' + user.username
  },
  set: (v) => {
    user.username = v
  }
})

</script>

<style scoped>

</style>
